import request from './http'
//首页
export const getInfo = (val) => {
    return new Promise((resolve, reject) => {
        request.post('/api/my/get_userinfo', val).then(res => {
            resolve(res);
        })
    })
};
export const profitApi = (val) => {
    return new Promise((resolve, reject) => {
        request.post('/api/index/get_profit', val).then(res => {
            resolve(res);
        })
    })
};
export const getBanner = (val) => {
    return new Promise((resolve, reject) => {
        request.post('/api/getBanner', val).then(res => {
            resolve(res);
        })
    })
};
export const celebrityListApi = (val) => {
    return new Promise((resolve, reject) => {
        request.post('/api/index/get_roll', val).then(res => {
            resolve(res);
        })
    })
};
export const getHomeData = (val) => {
    return new Promise((resolve, reject) => {
        request.post('/api/index/home', val).then(res => {
            resolve(res);
        })
    })
};
export const getHeadList = (val) => {
    return new Promise((resolve, reject) => {
        request.post('/api/my/headlist', val).then(res => {
            resolve(res);
        })
    })
};
export const getService = (val) => {
    return new Promise((resolve, reject) => {
        request.post('/api/getService', val).then(res => {
            resolve(res);
        })
    })
};
//登录、注册
export const login = (val) => {
    return new Promise((resolve, reject) => {
        request.post('/api/user/login', val).then(res => {
            resolve(res);
        })
    })
};
export const register = (val) => {
    return new Promise((resolve, reject) => {
        request.post('/api/user/do_register', val).then(res => {
            resolve(res);
        })
    })
}
//订单
export const orderList = (val) => {
    return new Promise((resolve, reject) => {
        request.post('/api/order/order_list', val).then(res => {
            resolve(res);
        })
    })
}
export const confirmOrderTwo = (val) => {
    return new Promise((resolve, reject) => {
        request.post('/api/order/do_order', val).then(res => {
            resolve(res);
        })
    })
}

export const getTradInfo = (val) => {
    return new Promise((resolve, reject) => {
        request.post('/api/rot_order/index', val).then(res => {
            resolve(res);
        })
    })
}
//匹配订单
export const matchOrder = (val) => {
    return new Promise((resolve, reject) => {
        request.post('/api/rot_order/submit_order', val).then(res => {
            resolve(res);
        })
    })
}
//团队
export const receiveBonus = (val) => {
    return new Promise((resolve, reject) => {
        request.post('/api/my/receive_commission', val).then(res => {
            resolve(res);
        })
    })
}
export const getTeam = (val) => {
    return new Promise((resolve, reject) => {
        request.post('/api/my/teamList', val).then(res => {
            resolve(res);
        })
    })
}
//修改信息
export const updateUserInfo = (val) => {
    return new Promise((resolve, reject) => {
        request.post('/api/my/edit_user', val).then(res => {
            resolve(res);
        })
    })
}
//提现
export const withdraw = (val) => {
    return new Promise((resolve, reject) => {
        request.post('/api/withdraw/withdraw', val).then(res => {
            resolve(res);
        })
    })
}
//提现
export const receive = (val) => {
    return new Promise((resolve, reject) => {
        request.post('/api/withdraw/withdraw1', val).then(res => {
            resolve(res);
        })
    })
}
//提现地址
export const bindBank = (val) => {
    return new Promise((resolve, reject) => {
        request.post('/api/my/bind_bank', val).then(res => {
            resolve(res);
        })
    })
}
//新支付
export const selectPay = (val) => {
    return new Promise((resolve, reject) => {
        request.post('/api/selectPay', val).then(res => {
            resolve(res);
        })
    })
}
export const createStarsOrder = (val) => {
    return new Promise((resolve, reject) => {
        request.post('/api/createStarsOrder', val).then(res => {
            resolve(res);
        })
    })
}
//充值
export const recharge = (val) => {
    return new Promise((resolve, reject) => {
        request.post('/api/recharge', val).then(res => {
            resolve(res);
        })
    })
}
//流水记录
export const flowLog = (val) => {
    return new Promise((resolve, reject) => {
        request.post('/api/my/flowLog', val).then(res => {
            resolve(res);
        })
    })
}
//记录页*3
export const getTransaction = (val) => {
    return new Promise((resolve, reject) => {
        request.post('/api/my/transaction', val).then(res => {
            resolve(res);
        })
    })
}
export const getWithdraw = (val) => {
    return new Promise((resolve, reject) => {
        request.post('/api/withdraw/withdrawlog', val).then(res => {
            resolve(res);
        })
    })
}
export const getRecharge = (val) => {
    return new Promise((resolve, reject) => {
        request.post('/api/my/rechargeLog', val).then(res => {
            resolve(res);
        })
    })
}

export const get_order_info_list = (val) => {
    return new Promise((resolve, reject) => {
        request.post('/api/order/order_info_list', val).then(res => {
            resolve(res);
        })
    })
}
export const payRecharge = (val) => {
    return new Promise((resolve, reject) => {
        request.post('/api/my/recharge', val).then(res => {
            resolve(res);
        })
    })
}
export const qxRecharge = (val) => {
    return new Promise((resolve, reject) => {
        request.post('/api/my/qx_recharge', val).then(res => {
            resolve(res);
        })
    })
}
export const recharge_info = (val) => {
    return new Promise((resolve, reject) => {
        request.post('/api/my/recharge_info', val).then(res => {
            resolve(res);
        })
    })
}
// bank_type 1银行卡 2usdt
// bankname 所属银行或 usdt类型
// cardnum 银行卡号或者钱包地址
// username 真实姓名
export const bind_bank = (val) => {
    return new Promise((resolve, reject) => {
        request.post('/api/my/bind_bank', val).then(res => {
            resolve(res);
        })
    })
}
export const getbankinfo = (val) => {
    return new Promise((resolve, reject) => {
        request.post('/api/my/getbankinfo', val).then(res => {
            resolve(res);
        })
    })
}
export const del_bank = (val) => {
    return new Promise((resolve, reject) => {
        request.post('/api/my/del_bank', val).then(res => {
            resolve(res);
        })
    })
}
export const user_recharge = (val) => {
    return new Promise((resolve, reject) => {
        request.post('/api/my/user_recharge', val).then(res => {
            resolve(res);
        })
    })
}
export const uploadImg = (val) => {
    return new Promise((resolve, reject) => { // /index/login/upload
        request.post('/api/my/up_img', val, {
            headers: {
                'Content-Type': 'multipart/form-data',
            },
        }).then(res => {
            resolve(res);
        })
    })
}

